package com.example.demo.service.impl;

import com.example.demo.entiy.Article;
import com.example.demo.mapper.ArticleMapper;
import com.example.demo.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    ArticleMapper articleMapper;

    @Override
    public List<Article> getArticleList() {
        return articleMapper.getArticleList();
    }

    @Override
    public Article getArticleByArticleId(Integer articleId) {
        return articleMapper.getArticleByArticleId(articleId);
    }

    @Override
    public Article getArticleCommentByArticleId(Integer articleId) {
        return articleMapper.getArticleCommentByArticleId(articleId);
    }

    @Override
    public List<Article> getArticleOrderDesc() {
        return articleMapper.getArticleOrderDesc();
    }

    @Override
    public int getAllArticleCount() {
        return articleMapper.getAllArticleCount();
    }

    @Override
    public List<Article> getArticleOrderByCreatedDesc() {
        return articleMapper.getArticleOrderByCreatedDesc();
    }

    @Override
    public int insertArticleByArticle(Article article) {
        return articleMapper.insertArticleByArticle(article);
    }

    @Override
    public List<Article> getArticleListAndHits() {
        return articleMapper.getArticleListAndHits();
    }

    @Override
    public int deleteArticleByArticleId(Integer articleId) {
        return articleMapper.deleteArticleByArticleId(articleId);
    }

    @Override
    public int updateArticleByArticleId(Article article) {
        return articleMapper.updateArticleByArticleId(article);
    }

    @Override
    public Article getArticleCategoriesByArticleId(Integer articleId) {
        return articleMapper.getArticleCategoriesByArticleId(articleId);
    }

}
